/**
 * 
 */
package com.wskj.library.advice.controller;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;

import com.wskj.library.service.AdviceService;
import com.wskj.library.service.impl.AdviceServiceImpl;
import com.wskj.util.StringUtil;

/**
 * @author 胡洋
 * @describe
 * @Date 2018年3月26日上午11:05:59
 * @version 1.0
 */
@WebServlet(urlPatterns = "/advice/delete.do")
public class DeleteAdviceServlet extends HttpServlet {
	AdviceService service=new AdviceServiceImpl(); 
	protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
			throws javax.servlet.ServletException, java.io.IOException {
	  
	   doPost(req, resp);
	};

	protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
			throws javax.servlet.ServletException, java.io.IOException {
	    int id=StringUtil.nullToInt(req.getParameter("id"));
		boolean result = service.deleteAdviceById(id);
		resp.sendRedirect(req.getContextPath()+"/advice/list.do");
	};
}
